/*
 * DoHouseWork.java
 *
 * Created on March 27, 2007, 4:40 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package ai9hells.pgaibe.chapter2.westworldwithmessaging;

import ai9hells.pgaibe.common.fsm.State;
import ai9hells.pgaibe.common.messaging.Telegram;

/**
 *
 * @author andre.bandarra
 */
public class DoHouseWork extends State<MinersWife>{
    public static final DoHouseWork instance = new DoHouseWork();
    /** Creates a new instance of DoHouseWork */
    private DoHouseWork() {
    }

    public void enter(MinersWife m) {
        System.out.println(EntityNames.getNameOfEntity(m.getId())+": Time to do some more housework!");                
    }

    public void execute(MinersWife m) {
        int x = (int)Math.round(Math.floor(Math.random() * 3));
        switch(x){
            case 0:
                System.out.println(EntityNames.getNameOfEntity(m.getId())+": Moppin' the floor"); break;
            case 1:
                System.out.println(EntityNames.getNameOfEntity(m.getId())+": Washin' the dishes"); break;                
            case 2:
                System.out.println(EntityNames.getNameOfEntity(m.getId())+": Makin' the bed"); break;                
        }

    }

    public void exit(MinersWife m) {
    }

    public boolean onMessage(MinersWife entity, Telegram t) {
        return false;
    }
    
}
